<template>
  <div class="header">
    <ul class="firstnav">
      <li>
        <h3 class="logo"><img src="../assets/logo.jpg">
          <i>Vue</i>
        </h3>
      </li>
      <li>
        <router-link to="/">首页</router-link>
      </li>
      <li>
        <router-link to="/pubish" @click.native="fn">发表</router-link>
      </li>
      <li>
        <router-link to="/message">消息</router-link>
      </li>
      <li>
        <router-link to="/user">我的</router-link>
      </li>
      <li>
        <router-link to="/about">关于</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: "1"
    };
  },
  methods: {
    fn() {
      console.log("您点击了弹窗");
    }
  }
};
</script>

<style lang="scss">
$fs: 18px;
.header {
  box-shadow: 0 1px 4px #ccc;
  font-size: 15px;
  background: #fff;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1;
  .firstnav {
    display: block;
    width: 1000px;
    padding: 0;
    margin: 0 auto;
    li {
      display: inline-block;
      height: 50px;
      margin: 10px 0;
      .logo {
        margin: 0 100px 0 0;
        color: #41b883;
        img {
          display: inline-block;
          width: 50px;
          height: 50px;
        }
      }
      a {
        line-height: 50px;
        padding: 5px 14px;
        margin: 0 10px;
        font-size: $fs;
        &:hover {
          background: #d81616;
          border-radius: 2px;
          color: #fff;
        }
      }
    }
  }
}
</style>